import { Loading } from 'element-ui';

export default {

  data() {
    return {
      loading: false
    };
  },

  methods: {
    startLoading() {
      // debuggerx
      // console.log(this.$el)
      if (this.$el && this.$el.className.indexOf('el-dialog') > -1) {
        this.loadingInstance = Loading.service({target: this.$el.children[0]});
      } else if(this.$el) {
        this.loadingInstance = Loading.service({target: this.$el});
      }
    },

    closeLoading() {
      this.loadingInstance.close();
    }
  }

};
